package cn.tedu.spring.life;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author ruoLi
 */
public class TestUser {
    @Test
    public void test(){
        ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("bean-life.xml");
        User user= context.getBean("user",User.class );
        System.out.println("使用阶段");
        System.out.println(user.getUsername());
        context.close();
    }
}
